﻿using UnityEngine;
using System.Collections;

public class GameStatus : MonoBehaviour {

	public static string currentLevel{get; set;}
	public static string difficulty{get; set;}
	public GameObject ExitMenu;
	
	private bool isPaused;
	//Private Variables
	private string subPath ="GameFiles";
	private string txtFileName = "stats.txt";

	void Start(){
		isPaused = false;
	}

	void Update(){
		if(Input.GetKeyDown(KeyCode.Escape) && !isPaused){
				Time.timeScale = 0.0f;
				Vector3 position = GameObject.Find("Main Camera").transform.position;
				Vector3 fixedPos = new Vector3(position.x,position.y,1.0f);
				Instantiate(ExitMenu, fixedPos, Quaternion.identity);
				isPaused = true;
				print("Time Frozen");		
		}
		
		if(isPaused){
			if(Input.GetKeyDown(KeyCode.Y)){
					Application.Quit();
				}
				if(Input.GetKeyDown(KeyCode.N)){
					Destroy(GameObject.Find("ExitMenu(Clone)"));
					Time.timeScale = 1.0f;
					isPaused = false;
					print("Time Unfrozen");
				}
		}

	}
}	